#!/usr/bin/env python
'''
__author__=Yawei Yang
__date__ = June 21th 2012
__doc__ =  Program 2-1 for chapter 2
'''

from control.matlab import *

num1 = [10]
den1 = [1, 2, 10]
num2 = [5]
den2 = [1, 5]
sys1 = tf(num1, den1)
sys2 = tf(num2, den2)

sereisSys = series(sys1, sys2)
# just to show how to get num and den from a new system
num = sereisSys.num
den = sereisSys.den
print sereisSys
#       50
#-----------------------
#s^3 + 7 s^2 + 20 s + 50

parallelSys = parallel(sys1, sys2)
print parallelSys
#  5 s^2 + 20 s + 100
#-----------------------
#s^3 + 7 s^2 + 20 s + 50

feedbackSys = feedback(sys1, sys2)
print feedbackSys
#       10 s + 50
#------------------------
#s^3 + 7 s^2 + 20 s + 100
